<?php

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CommesseTable extends Migration {

	/**
	 * Run the migrations.
	 *
	 * @return void
	 */
	public function up()
	{
		Schema::create('commesse', function($table)
		{
			$table->string('numero');
			$table->integer('fase');
			$table->string('id_strumento_misura');
			$table->string('articolo');
			$table->string('macchina');
			$table->integer('posizione');
			$table->timestamp('data_inizio');
			$table->timestamp('data_fine')->nullable();
			$table->timestamps();
			
			$table->primary(array('numero','fase', 'id_strumento_misura'));
		});
	}

	/**
	 * Reverse the migrations.
	 *
	 * @return void
	 */
	public function down()
	{
		Schema::drop('commesse');
	}

}
